<%@ page contentType="text/html;charset=UTF-8"%>
<!-- <script type="text/javascript">
// $(document).ready(function (){
// 	$('#updatePwdModal').on('shown.bs.modal', function (e){
// 		alert("==")
// 		$("#oldPassword").val("");
// 		$("#newPassword").val("");
// 		$("#newPassword2").val("");
// 		$("#msg").html("");
// 	})
// });
</script> -->


<div class="modal fade" id="changeSkinModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog" style="width:465px;height: 300px;">
    <div class="modal-content modal_1">
      <div class="modal-header modal_2">
        <button type="button" id="closeWin" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h5 class="modal-title Grey" id="myModalLabel"><span class="glyphicon glyphicon-ok Blue margin_1"></span>切换皮肤</h5>
      </div>
	      <div class="modal-body">
	      		<ul	id="pic">		
	      		</ul>
	     </div>
	      <div class="modal-footer modal_3" style="clear:both;">
	       		<button type="button" onclick="return chooseSkin()"   class="btn btn-danger btn_5">确认皮肤</button>
	      </div>
	   <script language="JavaScript" src="${staticPath}/js/skin.js" type="text/javascript"></script>   
       <script type="text/javascript">
       
       
	       var cssPath = getCookie("cssPath"); //获取默认皮肤路径  
	       var choose = getCookie("choose");
			//判断用户Cookie中是否有路径,无采用默认,有采用用户的信息  
			/* alert(cssPath); */
			if (cssPath != null && cssPath != ""){ 
			    document.write("<link href=${staticPath}/skin/"+ cssPath + "/css/main0.css" +" id='style' rel='stylesheet' type='text/css' />"); 
			}else{  
			    setCookie('cssPath',"blue",365); 
			    document.write("<link href=${staticPath}/skin/blue/css/main0.css"+" id='style' rel='stylesheet' type='text/css' />");  
			} 
       	
	       	$(document).ready(function (){       		
	       		$.ajax({
					url: '${contextPath}/sys/site/skin/getAllSkin',
					dataType: 'json',
					async: false,
					success: function(data) {						
						for(var i = 0; i < data.length; i++) {
							$("#pic").append("<li style='float:left;margin-right:15px;margin-bottom:15px;width:125px;height:75px;' id='select"+i+"'>"+
							"<a href='javascript:void(0)'><img title='"+data[i].name+
							"'"+" src='"+"${staticPath}/skin/"+data[i].skin+"/snapshot.png"
									+"'"+" style='width:123px;height:73px;' value='"+data[i].skin+"' id='imgId"
									+i+"'onclick='changeCss(window.top,"+i+","+data.length+")'>"+"</a></li>");
						} 
					}
			 	}); 
	       		
	       		if(choose!=null&&choose!=''){
	       			
	       			$(choose).css({'border-width':'1px','border-color':'#f00','border-style':'solid'});
	       		}
	       		else{
	       			var imgLen = $("img[value='blue']").attr("id");
	       			if(imgLen!=null&&imgLen!=''){
	       				var liId = imgLen.substring(imgLen.length-1);
	       			}	
	       			$("#select"+liId).css({'border-width':'1px','border-color':'#f00','border-style':'solid'});
	       		}
       		});

        </script>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->